package algorithm.annotation_demo;

/**
 * 带注解的实体类，建立了对象和表的映射关系，可以在运行时被解析
 */
@Mytable("t_user")
public class User {
    @MyColumn(value = "id",constraint = @Constraints(primaryKey = true))
    private String id;

    @MyColumn(value = "name")
    private String name;

    @MyColumn(value = "age", type = "INT", constraint=@Constraints(nullable = true))
    private int age;

    @MyColumn(value = "phone_number", constraint = @Constraints(unique = true))
    private String phoneNumber;
}
